<?php
include("sessionUser.php");
include("Conexao.php");

$conexao = new Conexao();

$con = $conexao->conectBD();




$sql = "SELECT a.*,b.nome AS cat,c.nome AS fab,d.nome AS forn,e.nome AS loja,f.nome AS plat,
g.nome AS jog,h.nome AS con FROM tbPerfil_equipe05 a INNER JOIN tbCategoria_equipe05 b 
ON a.idCategoria=b.id INNER JOIN tbFabricante_equipe05 c ON a.idFabricante=c.id 
INNER JOIN  tbFornecedor d ON a.idFornecedor = d.codigo INNER JOIN tbLoja e ON a.idLoja = e.codigo
INNER JOIN tbPlataforma_equipe05 f ON a.idPlataforma = f.id INNER JOIN tbJogabilidade_equipe05 g ON 
a.idJogabilidade = g.id INNER JOIN tbConectividade_equipe05 h ON a.idConectividade = h.id WHERE a.idUsuario = ".$_GET["id"]; // seleciona todos os perfis do usuario


$result = pg_query($sql);
?>


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <LINK REL=StyleSheet HREF="main.css" TYPE="text/css" MEDIA=screen>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>   
    <link rel="stylesheet" href="main.css" />
    </head>
    <body>
        
         <h2 >LISTA DE PERFIS DO USUÁRIO</h2> <br>
        
        <table border="0" width="100%" align="center" style="border: 1px solid #ccc;">
            <thead>
                <tr align="center" style="border: 1px solid #ccc;">
                    <td align="center" ><strong>Categoria</strong></td>
                    <td align="center" ><strong>Fabricante</strong></td>
                    <td align="center" ><strong>Fornecedor</strong></td>
                    <td align="center" ><strong>Loja</strong></td>
                    <td align="center" ><strong>Plataforma</strong></td>
                    <td align="center" ><strong>Jogabilidade</strong></td>
                    <td align="center" ><strong>Conectividade</strong></td>
                    
                </tr>
            </thead>
            <tbody>
                <?php while ($colum = pg_fetch_array($result)) { ?>  
                <tr style="border: 1px solid #ccc;">
                    <td align="center" style="border: 1px solid #ccc;">
                      <?php echo $colum["cat"]; ?>  
                    </td>
                    <td align="center" style="border: 1px solid #ccc;">
                      <?php echo $colum["fab"]; ?>  
                    </td>
                    <td align="center" style="border: 1px solid #ccc;">
                      <?php echo $colum["forn"]; ?>  
                    </td>
                    <td align="center" style="border: 1px solid #ccc;">
                      <?php echo $colum["loja"]; ?>  
                    </td>
                    <td  align="center" style="border: 1px solid #ccc;">
                      <?php echo $colum["plat"]; ?>  
                    </td>
                    <td align="center" style="border: 1px solid #ccc;">
                      <?php echo $colum["jog"]; ?>  
                    </td>
                   <td align="center" style="border: 1px solid #ccc;">
                      <?php echo $colum["con"]; ?>  
                    </td>
                </tr>
                 <?php } $conexao->desconectBD(); ?>
                
            </tbody>
           
            
        </table>
        
    </body>
  
    
</html>